/*
 * @Description:签约管理
 * @Author: 龙春雨
 * @Date: 2023-04-11 09:49:21
 */
import request from '@/router/axios';
/**
 * 获取列表
 * @param {*} query
 * @returns
 */
export function fetchPage(query) {
  return request({
    url: '/core/agreement/petInfo/page',
    method: 'get',
    params: query,
  });
}

/**
 * 新增
 * @param {*} data
 * @returns
 */
export function addObj(data) {
  return request({
    url: '/core/agreement',
    method: 'post',
    data: data,
  });
}

/**
 * 作废
 * @param {*} data
 * @returns
 */
export function cancelObj(id) {
  return request({
    url: `/core/agreement/${id}`,
    method: 'delete',
  });
}

/**
 * 协议签署
 * @param {*} data
 * @returns
 */
export function signObj(data) {
  return request({
    url: '/core/agreement/sign',
    method: 'post',
    data: data,
  });
}

/**
 * 获取详情
 * @param {*} data
 * @returns
 */
export function getObj(id) {
  return request({
    url: `/core/agreement/${id}`,
    method: 'get',
  });
}

/**
 * 获取宠物列表
 * @param {*} data
 * @returns
 */
export function getPetList(params) {
  return request({
    url: '/core/pet/info/customer/list',
    method: 'get',
    params,
  });
}

/**
 * 获取用户所属基地待领养的宠物列表
 * @param {*} data
 * @returns
 */
export function getPetListByBaseId() {
  return request({
    url: `/core/pet/info/platform/list`,
    method: 'get',
  });
}
//查询待领养 已领养宠物
export function selectAdoptPet() {
  return request({
    url: '/core/pet/info/platform/shelf/list',
    method: 'get',
  });
}
/**
 * 获取领养人列表
 * @param {*} data
 * @returns
 */
export function getPhoneList(params) {
  return request({
    url: '/app/appuser/list',
    method: 'get',
    params,
  });
}
//查看宠物
export function agreementPetinfoList(params) {
  return request({
    url: '/core/agreementpetinfo/list',
    method: 'get',
    params,
  });
}
//查看送养人宠物编号
export function selectPetById(giverId) {
  return request({
    url: `/core/pet/info/list/${giverId}`,
    method: 'get',
  });
}
// 查询领养协议和送样协议
export function selectDetailById(id) {
  return request({
    url: `/core/agreement/detail/${id}`,
    method: 'get',
  });
}
